package com.zhongyu.provider.service;

import com.zhongyu.comm.api.CommentApi;
import com.zhongyu.comm.vo.CommentVo;
import com.zhongyu.provider.mapper.CommentMapper;
import com.zhongyu.provider.pojo.Comment;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class CommentApiImpl implements CommentApi {

    @Resource
    private CommentMapper commentMapper;


    @Override
    public int add1(CommentVo commentVo) {
        Comment comment = new Comment();
        BeanUtils.copyProperties(commentVo,comment);
        return commentMapper.insert(comment);
    }

    /*@Override
    public int add2(CommentVo commentVo) {
        Comment comment = new Comment();
        BeanUtils.copyProperties(commentVo,comment);
        return commentMapper.insert(comment);
    }*/
}
